package app.caihan.wanandroid.ui.welcome

import android.os.Bundle
import app.caihan.scframe.base.activity.BaseActivity
import app.caihan.wanandroid.R
import app.caihan.wanandroid.ui.LauncherUi
import com.blankj.utilcode.constant.PermissionConstants
import com.blankj.utilcode.util.ActivityUtils
import com.blankj.utilcode.util.PermissionUtils

class WelcomeActivity : BaseActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        requestPermission(object : PermissionUtils.SimpleCallback {
            override fun onGranted() {
                window.decorView.postDelayed({
                    ActivityUtils.startActivity(LauncherUi::class.java)
                    ActivityUtils.finishActivity(WelcomeActivity::class.java)
                }, 1000)
            }

            override fun onDenied() {
            }
        }, PermissionConstants.CAMERA, PermissionConstants.STORAGE)
    }

    override fun bindLayoutId(): Int {
        return R.layout.activity_welcome
    }
}